<script setup lang="ts"></script>

<template>
  <h1>事件日志</h1>
  <div class="event-logs card">
      
      <div class="filter-bar">
        <p>事件等级：</p>
        <select v-model="logLevelFilter" class="filter-select">
          <option value="ALL">所有等级</option>
          <option value="INFO">INFO</option>
          <option value="ERROR">ERROR</option>
        </select>
        <p>事件类型：</p>
        <select v-model="logTypeFilter" class="filter-select">
          <option value="ALL">所有类型</option>
          <option value="任务创建">任务创建</option>
          <option value="任务部署">任务部署</option>
        </select>
      </div>
      <table class="log-table">
        <thead>
          <tr>
            <th>事件 ID</th>
            <th>事件等级</th>
            <th>事件代码</th>
            <th>事件类型</th>
            <th>发生时间</th>
            <th>描述信息</th>
            <th>处理方案</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="log in filteredLogs" :key="log.id">
            <td>{{ log.id }}</td>
            <td>{{ log.level }}</td>
            <td>{{ log.code }}</td>
            <td>{{ log.type }}</td>
            <td>{{ log.time }}</td>
            <td>{{ log.description }}</td>
            <td>{{ log.solution }}</td>
          </tr>
        </tbody>
      </table>
    </div>
</template>


<style scoped>
.card {
  border: 1px solid #ddd;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #fff;
}
.charts {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}
.chart {
  width: 50%;
  height: 200px;
}
.log-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.log-table th,
.log-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
</style>